import java.util.List;
import java.util.Random;

public class Group {
    private int groupId;
    private List<Student> students;

    public Group(int groupId, List<Student> students) {
        this.groupId = groupId;
        this.students = students;
    }

    public int getGroupId() {
        return groupId;
    }

    public List<Student> getStudents() {
        return students;
    }

    // 随机选择一个学生
    public Student getRandomStudent() {
        Random random = new Random();
        int index = random.nextInt(students.size());
        return students.get(index);
    }

    @Override
    public String toString() {
        return "Group{" +
                "groupId=" + groupId +
                ", students=" + students +
                '}';
    }
}
